<template>
  <div class="map-view-warp">
    <div ref="map" class="map-body"></div>
  </div>
</template>

<script>
import olmap from './libs/core/map'
import mapOptions from './config/gis.json'

export default {
  name: 'MapView',
  components: {},
  props: {
    mapOptions: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data() {
    return {
      map: null,
      checkList: [],
      indexKey: null
    }
  },
  mounted() {
    this.initMap()
  },
  methods: {
    // 初始化一个 openlayers 地图
    initMap() {
      let mapel = this.$refs.map
      let map = new olmap(mapel, {
        ...mapOptions
      })

      setTimeout(() => {
        map.createPoint()
      }, 1000)
    },
    clickHandle() {
    }
  }
}
</script>
<style lang="scss" scoped>
  .map-view-warp {
    width: 100%;
    height: 100%;
  }

  .map-body {
    width: 100%;
    height: 100%;
  }
</style>
